package com.medassistent.gui;

import java.util.Locale;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Farmacias extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_farmacias);

		
		Button bntMapa = (Button) findViewById(R.id.mapa);
		Button bntHospital = (Button) findViewById(R.id.hospital);

		bntMapa.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				String uri = String.format(Locale.ENGLISH, "geo:0,0?q=farmacia");
				Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
				startActivity(intent);

			}
		});
		
		bntHospital.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				String uri = String.format(Locale.ENGLISH, "geo:0,0?q=hospital");
				Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
				startActivity(intent);
			}
		});



	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.farmacias, menu);
		return true;
	}

}
